package top.namelessman.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import top.namelessman.service.AccountService;

@Controller
@RequestMapping("/user")
public class AccountHandler {
    @Autowired
    private AccountService accountService;

    @GetMapping("/index")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView("index");
        modelAndView.addObject(accountService.findAll());
        return modelAndView;
    }

}
